import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

// // 1. 全局注册指令
Vue.directive('loading', {
    inserted(el, binding) {
        if (binding.value === true) {
            el.classList.add('loading')
        } else {
            el.classList.remove('loading')
        }
    },
    update(el, binding) {
        if (binding.value === true) {
            el.classList.add('loading')
        } else {
            el.classList.remove('loading')
        }
    }
})


new Vue({
    render: h => h(App),
}).$mount('#app')